	org 16400
__START_PROGRAM:
	di
	push ix
	push iy
	exx
	push hl
	exx
	ld hl, 0
	add hl, sp
	ld (__CALL_BACK__), hl
	ei
	jp __LABEL__charmap01end
__LABEL__charmap01:
#line 2
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00011000
		defb %00111100
		defb %00111100
		defb %00011000
		defb %00011000
		defb %00000000
		defb %00011000
		defb %00000000
		defb %01101100
		defb %01101100
		defb %01101100
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %01101100
		defb %01101100
		defb %11111110
		defb %01101100
		defb %11111110
		defb %01101100
		defb %01101100
		defb %00000000
		defb %00011000
		defb %00111110
		defb %01100000
		defb %00111100
		defb %00000110
		defb %01111100
		defb %00011000
		defb %00000000
		defb %00000000
		defb %11000110
		defb %11001100
		defb %00011000
		defb %00110000
		defb %01100110
		defb %11000110
		defb %00000000
		defb %00111000
		defb %01101100
		defb %00111000
		defb %01110110
		defb %11011100
		defb %11001100
		defb %01110110
		defb %00000000
		defb %00001100
		defb %00001100
		defb %00011000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00001100
		defb %00011000
		defb %00110000
		defb %00110000
		defb %00110000
		defb %00011000
		defb %00001100
		defb %00000000
		defb %00110000
		defb %00011000
		defb %00001100
		defb %00001100
		defb %00001100
		defb %00011000
		defb %00110000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %01100110
		defb %00111100
		defb %11111111
		defb %00111100
		defb %01100110
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00011000
		defb %00011000
		defb %01111110
		defb %00011000
		defb %00011000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00011000
		defb %00001000
		defb %00010000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %01111110
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00011000
		defb %00011000
		defb %00000000
		defb %00000011
		defb %00000110
		defb %00001100
		defb %00011000
		defb %00110000
		defb %01100000
		defb %11000000
		defb %00000000
		defb %00111000
		defb %01001100
		defb %11000110
		defb %11000110
		defb %11000110
		defb %01100100
		defb %00111000
		defb %00000000
		defb %00011000
		defb %00111000
		defb %00011000
		defb %00011000
		defb %00011000
		defb %00011000
		defb %01111110
		defb %00000000
		defb %01111100
		defb %11000110
		defb %00001110
		defb %00111100
		defb %01111000
		defb %11100000
		defb %11111110
		defb %00000000
		defb %11111110
		defb %00001100
		defb %00011000
		defb %00111100
		defb %00000110
		defb %11000110
		defb %01111100
		defb %00000000
		defb %00011100
		defb %00111100
		defb %01101100
		defb %11001100
		defb %11111110
		defb %00001100
		defb %00001100
		defb %00000000
		defb %11111100
		defb %11000000
		defb %11111100
		defb %00000110
		defb %00000110
		defb %11000110
		defb %01111100
		defb %00000000
		defb %00111100
		defb %01100000
		defb %11000000
		defb %11111100
		defb %11000110
		defb %11000110
		defb %01111100
		defb %00000000
		defb %11111110
		defb %00000110
		defb %00001100
		defb %00011000
		defb %00110000
		defb %00110000
		defb %00110000
		defb %00000000
		defb %01111000
		defb %11000100
		defb %11100100
		defb %01111000
		defb %10011110
		defb %10000110
		defb %01111100
		defb %00000000
		defb %01111100
		defb %11000110
		defb %11000110
		defb %01111110
		defb %00000110
		defb %00001100
		defb %01111000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00011000
		defb %00011000
		defb %00000000
		defb %00011000
		defb %00011000
		defb %00000000
		defb %00000000
		defb %00011000
		defb %00011000
		defb %00000000
		defb %00011000
		defb %00001000
		defb %00010000
		defb %00000000
		defb %00001100
		defb %00011000
		defb %00110000
		defb %01100000
		defb %00110000
		defb %00011000
		defb %00001100
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %01111110
		defb %00000000
		defb %01111110
		defb %00000000
		defb %00000000
		defb %00110000
		defb %00011000
		defb %00001100
		defb %00000110
		defb %00001100
		defb %00011000
		defb %00110000
		defb %00000000
		defb %01111100
		defb %11000110
		defb %00000110
		defb %00011100
		defb %00110000
		defb %00000000
		defb %00110000
		defb %00000000
		defb %01111100
		defb %11000110
		defb %11011110
		defb %11011110
		defb %11011110
		defb %11000000
		defb %01111100
		defb %00000000
		defb %00111000
		defb %01101100
		defb %11000110
		defb %11000110
		defb %11111110
		defb %11000110
		defb %11000110
		defb %00000000
		defb %11111100
		defb %11000110
		defb %11000110
		defb %11111100
		defb %11000110
		defb %11000110
		defb %11111100
		defb %00000000
		defb %00111100
		defb %01100110
		defb %11000000
		defb %11000000
		defb %11000000
		defb %01100110
		defb %00111100
		defb %00000000
		defb %11111000
		defb %11001100
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11001100
		defb %11111000
		defb %00000000
		defb %11111110
		defb %11000000
		defb %11000000
		defb %11111100
		defb %11000000
		defb %11000000
		defb %11111110
		defb %00000000
		defb %11111110
		defb %11000000
		defb %11000000
		defb %11111100
		defb %11000000
		defb %11000000
		defb %11000000
		defb %00000000
		defb %00111110
		defb %01100000
		defb %11000000
		defb %11001110
		defb %11000110
		defb %01100110
		defb %00111110
		defb %00000000
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11111110
		defb %11000110
		defb %11000110
		defb %11000110
		defb %00000000
		defb %01111110
		defb %00011000
		defb %00011000
		defb %00011000
		defb %00011000
		defb %00011000
		defb %01111110
		defb %00000000
		defb %00000110
		defb %00000110
		defb %00000110
		defb %00000110
		defb %11000110
		defb %11000110
		defb %01111100
		defb %00000000
		defb %11000110
		defb %11001100
		defb %11011000
		defb %11110000
		defb %11111000
		defb %11011100
		defb %11001110
		defb %00000000
		defb %11000000
		defb %11000000
		defb %11000000
		defb %11000000
		defb %11000000
		defb %11000000
		defb %11111110
		defb %00000000
		defb %11000110
		defb %11101110
		defb %11111110
		defb %11111110
		defb %11010110
		defb %11000110
		defb %11000110
		defb %00000000
		defb %11000110
		defb %11100110
		defb %11110110
		defb %11111110
		defb %11011110
		defb %11001110
		defb %11000110
		defb %00000000
		defb %01111100
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11000110
		defb %01111100
		defb %00000000
		defb %11111100
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11111100
		defb %11000000
		defb %11000000
		defb %00000000
		defb %01111100
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11011110
		defb %11001100
		defb %01111010
		defb %00000000
		defb %11111100
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11111000
		defb %11001100
		defb %11000110
		defb %00000000
		defb %01111000
		defb %11001100
		defb %11000000
		defb %01111100
		defb %00000110
		defb %11000110
		defb %01111100
		defb %00000000
		defb %01111110
		defb %00011000
		defb %00011000
		defb %00011000
		defb %00011000
		defb %00011000
		defb %00011000
		defb %00000000
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11000110
		defb %01111100
		defb %00000000
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11101110
		defb %01111100
		defb %00111000
		defb %00010000
		defb %00000000
		defb %11000110
		defb %11000110
		defb %11000110
		defb %11010110
		defb %11111110
		defb %11101110
		defb %11000110
		defb %00000000
		defb %11000110
		defb %11101110
		defb %01111100
		defb %00111000
		defb %01111100
		defb %11101110
		defb %11000110
		defb %00000000
		defb %01100110
		defb %01100110
		defb %01100110
		defb %00111100
		defb %00011000
		defb %00011000
		defb %00011000
		defb %00000000
		defb %11111110
		defb %00001110
		defb %00011100
		defb %00111000
		defb %01110000
		defb %11100000
		defb %11111110
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00111100
		defb %00111100
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %01111110
		defb %01111110
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00011000
		defb %00011000
		defb %00000000
		defb %00011000
		defb %00111100
		defb %00111100
		defb %00011000
		defb %00011000
		defb %00000000
		defb %00011000
		defb %00000000
		defb %00111100
		defb %01000010
		defb %10111001
		defb %10000101
		defb %10000101
		defb %10111001
		defb %01000010
		defb %00111100
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %00000000
		defb %10001000
		defb %00000000
		defb %00100010
		defb %00000000
		defb %10001000
		defb %00000000
		defb %00100010
		defb %00000000
		defb %10001000
		defb %10001000
		defb %00100010
		defb %00100010
		defb %10001000
		defb %10001000
		defb %00100010
		defb %00100010
		defb %10001000
		defb %10101010
		defb %00100010
		defb %10101010
		defb %10001000
		defb %10101010
		defb %00100010
		defb %10101010
		defb %11001100
		defb %10101010
		defb %00110011
		defb %10101010
		defb %11001100
		defb %10101010
		defb %00110011
		defb %10101010
		defb %11101110
		defb %10101010
		defb %10111011
		defb %10101010
		defb %11101110
		defb %10101010
		defb %10111011
		defb %10101010
		defb %11101110
		defb %11101110
		defb %10111011
		defb %10111011
		defb %11101110
		defb %11101110
		defb %10111011
		defb %10111011
		defb %11101110
		defb %11111111
		defb %10111011
		defb %11111111
		defb %11101110
		defb %11111111
		defb %10111011
		defb %11111111
		defb %11111111
		defb %11111111
		defb %11111111
		defb %11111111
		defb %11111111
		defb %11111111
		defb %11111111
		defb %11111111
#line 586
__LABEL__charmap01end:
	call _msxvideo9990initsuperimpose
	call _msxvideo9990cleanregisters
	ld a, 194
	push af
	ld a, 8
	push af
	call _msxvideo9990vdp
	ld a, 129
	push af
	ld a, 6
	push af
	call _msxvideo9990vdp
	ld hl, 0
	ld (_i), hl
	jp __LABEL0
__LABEL3:
	ld hl, (_i)
	ld de, 273
	call __MUL16_FAST
	push hl
	ld hl, (_i)
	ld a, l
	push af
	call _msxvideo9990palette12bit
	ld hl, (_i)
	inc hl
	ld (_i), hl
__LABEL0:
	ld hl, 15
	ld de, (_i)
	or a
	sbc hl, de
	jp nc, __LABEL3
	ld hl, 0
	push hl
	xor a
	push af
	call _msxvideo9990palette12bit
	ld hl, 0
	ld (_i), hl
	jp __LABEL5
__LABEL8:
	ld hl, (_i)
	add hl, hl
	ex de, hl
	ld hl, __LABEL__palette01
	add hl, de
	ld a, (hl)
	inc hl
	ld h, (hl)
	ld l, a
	push hl
	ld hl, (_i)
	ld a, l
	push af
	call _msxvideo9990palette12bit
	ld hl, (_i)
	inc hl
	ld (_i), hl
__LABEL5:
	ld hl, 15
	ld de, (_i)
	or a
	sbc hl, de
	jp nc, __LABEL8
	ld a, 32
	push af
	ld hl, 56797
	push hl
	ld hl, 65535
	push hl
	ld a, 12
	push af
	xor a
	push af
	ld hl, 212
	push hl
	ld hl, 256
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	call _msxvideo9990command
	ld hl, 2564
	push hl
	xor a
	push af
	call _msxvideo9990vpokelocp
	ld hl, 0
	ld (_x), hl
	jp __LABEL10
__LABEL13:
	ld a, 85
	push af
	call _msxvideo9990vpokeseq
	ld hl, (_x)
	inc hl
	ld (_x), hl
__LABEL10:
	ld hl, 8000
	ld de, (_x)
	or a
	sbc hl, de
	jp nc, __LABEL13
	ld hl, 0
	ld (_x), hl
	jp __LABEL15
__LABEL18:
	ld a, 170
	push af
	call _msxvideo9990vpokeseq
	ld hl, (_x)
	inc hl
	ld (_x), hl
__LABEL15:
	ld hl, 4000
	ld de, (_x)
	or a
	sbc hl, de
	jp nc, __LABEL18
	ld hl, 0
	ld (_x), hl
	jp __LABEL20
__LABEL23:
	ld a, 255
	push af
	call _msxvideo9990vpokeseq
	ld hl, (_x)
	inc hl
	ld (_x), hl
__LABEL20:
	ld hl, 2000
	ld de, (_x)
	or a
	sbc hl, de
	jp nc, __LABEL23
	ld hl, 0
	ld (_x), hl
	jp __LABEL25
__LABEL28:
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld hl, (_x)
	ld de, 4
	add hl, de
	add hl, hl
	add hl, hl
	add hl, hl
	ld (_dx), hl
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld hl, 184
	ld (_dy), hl
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld hl, (_x)
	ld de, 4369
	call __MUL16_FAST
	ld (_fc), hl
	ld a, 32
	push af
	ld hl, (_fc)
	push hl
	ld hl, 65535
	push hl
	ld a, 12
	push af
	xor a
	push af
	ld hl, 8
	push hl
	ld hl, 8
	push hl
	ld hl, (_dy)
	push hl
	ld hl, (_dx)
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	call _msxvideo9990command
	ld hl, (_x)
	inc hl
	ld (_x), hl
__LABEL25:
	ld hl, 15
	ld de, (_x)
	or a
	sbc hl, de
	jp nc, __LABEL28
	ld hl, 0
	ld (_e0), hl
	jp __LABEL30
__LABEL33:
	ld hl, 0
	ld (_e1), hl
	jp __LABEL35
__LABEL38:
	ld hl, (__LABEL__charmap01) - (256)
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	ld hl, (_e1)
	ld a, l
	push af
	ld hl, (_e0)
	ld a, l
	push af
	ld hl, 49
	push hl
	ld hl, (_e1)
	inc hl
	push hl
	ld hl, (_e0)
	ld de, 15
	add hl, de
	push hl
	call _putchar
	ld hl, (_e1)
	inc hl
	ld (_e1), hl
__LABEL35:
	ld hl, 15
	ld de, (_e1)
	or a
	sbc hl, de
	jp nc, __LABEL38
	ld hl, (_e0)
	inc hl
	ld (_e0), hl
__LABEL30:
	ld hl, 15
	ld de, (_e0)
	or a
	sbc hl, de
	jp nc, __LABEL33
	ld hl, (__LABEL__charmap01) - (256)
	push hl
	ld hl, 0
	push hl
	ld hl, 2
	push hl
	ld a, 5
	push af
	ld a, 3
	push af
	ld hl, 89
	push hl
	ld hl, 7
	push hl
	ld hl, 5
	push hl
	call _putchar
	ld hl, (__LABEL__charmap01) - (256)
	push hl
	ld hl, 2
	push hl
	ld a, 11
	push af
	ld a, 9
	push af
	ld hl, (__LABEL__text01end) - (__LABEL__text01)
	push hl
	ld hl, __LABEL__text01
	push hl
	ld hl, 21
	push hl
	ld hl, 3
	push hl
	call _writetext
	ld a, 16
	push af
	ld hl, 0
	push hl
	ld hl, 65535
	push hl
	ld a, 12
	push af
	xor a
	push af
	ld hl, 8
	push hl
	ld hl, 8
	push hl
	ld hl, 72
	push hl
	ld hl, 56
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	call _msxvideo9990command
	ld hl, 1
	ld (_ik), hl
	ld hl, 14
	ld (_pp), hl
	ld hl, 58
	ld (_seed), hl
	ld hl, 0
	ld (_x), hl
	jp __LABEL40
__LABEL43:
	ld hl, (_pp)
	ld a, l
	push af
	ld hl, (_ik)
	ld a, l
	push af
	ld de, __LABEL__charmap01
	ld hl, (_x)
	add hl, de
	push hl
	ld hl, (_seed)
	ld de, 74
	call __MODU16
	add hl, hl
	add hl, hl
	add hl, hl
	ex de, hl
	pop hl
	add hl, de
	ld a, (hl)
	push af
	call _ikpp4b
	ld hl, (_x)
	inc hl
	ld (_x), hl
__LABEL40:
	ld hl, 7
	ld de, (_x)
	or a
	sbc hl, de
	jp nc, __LABEL43
	ld hl, 1
	ld (_x), hl
	jp __LABEL45
__LABEL48:
	ld hl, (__LABEL__charmap01) - (256)
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	ld a, 1
	push af
	ld a, 15
	push af
	ld hl, (_x)
	ld de, 100
	call __DIVU16
	ld de, 0
	push de
	push hl
	ld de, 0
	ld hl, 10
	call __SWAP32
	call __MODI32
	ld bc, 0
	push bc
	ld bc, 48
	add hl, bc
	pop bc
	ex de, hl
	adc hl, bc
	ex de, hl
	push hl
	ld hl, 16
	push hl
	ld hl, 2
	push hl
	call _putchar
	ld hl, (__LABEL__charmap01) - (256)
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	ld a, 1
	push af
	ld a, 15
	push af
	ld hl, (_x)
	ld de, 10
	call __DIVU16
	ld de, 0
	push de
	push hl
	ld de, 0
	ld hl, 10
	call __SWAP32
	call __MODI32
	ld bc, 0
	push bc
	ld bc, 48
	add hl, bc
	pop bc
	ex de, hl
	adc hl, bc
	ex de, hl
	push hl
	ld hl, 16
	push hl
	ld hl, 3
	push hl
	call _putchar
	ld hl, (__LABEL__charmap01) - (256)
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	ld a, 1
	push af
	ld a, 15
	push af
	ld hl, (_x)
	ld de, 10
	call __MODU16
	ld de, 48
	add hl, de
	push hl
	ld hl, 16
	push hl
	ld hl, 4
	push hl
	call _putchar
#line 77
		halt
#line 78
	ld hl, (_x)
	inc hl
	ld (_x), hl
__LABEL45:
	ld hl, 300
	ld de, (_x)
	or a
	sbc hl, de
	jp nc, __LABEL48
	ld hl, 0
	ld (_x), hl
	jp __LABEL50
__LABEL53:
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld h, 0
	ld a, l
	and 15
	ld l, a
	ld de, 4369
	call __MUL16_FAST
	ld (_fc), hl
	ld a, 32
	push af
	ld hl, (_fc)
	push hl
	ld hl, 65535
	push hl
	ld a, 12
	push af
	xor a
	push af
	ld hl, 1
	push hl
	ld hl, 256
	push hl
	ld hl, (_x)
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	call _msxvideo9990command
	ld hl, (_x)
	inc hl
	ld (_x), hl
__LABEL50:
	ld hl, 211
	ld de, (_x)
	or a
	sbc hl, de
	jp nc, __LABEL53
__LABEL55:
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld h, 0
	ld a, l
	and 31
	ld l, a
	add hl, hl
	add hl, hl
	add hl, hl
	ld (_dx), hl
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld de, 27
	call __MODU16
	add hl, hl
	add hl, hl
	add hl, hl
	ld (_dy), hl
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld h, 0
	ld a, l
	and 15
	ld l, a
	ld de, 4369
	call __MUL16_FAST
	ld (_fc), hl
	ld a, 32
	push af
	ld hl, (_fc)
	push hl
	ld hl, 65535
	push hl
	ld a, 12
	push af
	xor a
	push af
	ld hl, 8
	push hl
	ld hl, 8
	push hl
	ld hl, (_dy)
	push hl
	ld hl, (_dx)
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	call _msxvideo9990command
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld h, 0
	ld a, l
	and 31
	ld l, a
	add hl, hl
	add hl, hl
	add hl, hl
	ld (_dx), hl
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld de, 27
	call __MODU16
	add hl, hl
	add hl, hl
	add hl, hl
	ld (_dy), hl
	ld a, 16
	push af
	ld hl, 0
	push hl
	ld hl, 65535
	push hl
	ld a, 12
	push af
	xor a
	push af
	ld hl, 8
	push hl
	ld hl, 8
	push hl
	ld hl, (_dy)
	push hl
	ld hl, (_dx)
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	call _msxvideo9990command
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld h, 0
	ld a, l
	and 15
	ld l, a
	ld (_ik), hl
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld h, 0
	ld a, l
	and 15
	ld l, a
	ld (_pp), hl
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld hl, 0
	ld (_x), hl
	jp __LABEL57
__LABEL60:
	ld hl, (_pp)
	ld a, l
	push af
	ld hl, (_ik)
	ld a, l
	push af
	ld de, __LABEL__charmap01
	ld hl, (_x)
	add hl, de
	push hl
	ld hl, (_seed)
	ld de, 74
	call __MODU16
	add hl, hl
	add hl, hl
	add hl, hl
	ex de, hl
	pop hl
	add hl, de
	ld a, (hl)
	push af
	call _ikpp4b
	ld hl, (_x)
	inc hl
	ld (_x), hl
__LABEL57:
	ld hl, 7
	ld de, (_x)
	or a
	sbc hl, de
	jp nc, __LABEL60
	ld hl, (_seed)
	call _msxrnd
	ld (_seed), hl
	ld hl, 0
	ld (_x), hl
	jp __LABEL62
__LABEL65:
	ld de, __LABEL__charmap01
	ld hl, (_x)
	add hl, de
	push hl
	ld de, 255
	ld hl, (_seed)
	call __BAND16
	ld de, 32
	call __MUL16_FAST
	ex de, hl
	pop hl
	add hl, de
	ld a, (hl)
	ld l, a
	ld h, 0
	ld (_i), hl
	ld a, l
	ld bc, 98
	out (c), a
	ld hl, (_x)
	inc hl
	ld (_x), hl
__LABEL62:
	ld hl, 31
	ld de, (_x)
	or a
	sbc hl, de
	jp nc, __LABEL65
	jp __LABEL55
	ld a, 32
	push af
	ld hl, 30583
	push hl
	ld hl, 65535
	push hl
	ld a, 12
	push af
	xor a
	push af
	ld hl, 8
	push hl
	ld hl, 8
	push hl
	ld hl, 56
	push hl
	ld hl, 40
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	call _msxvideo9990command
__LABEL67:
	jp __LABEL67
__LABEL__patterntest01:
__LABEL__palette01:
#line 116
		defw $000,$125,$725,$879
		defw $A53,$085,$F04,$554
		defw $F7A,$FA0,$CCC,$0E3
		defw $FCA,$2AF,$FE2,$FFE
#line 120
__LABEL__text01:
#line 124
		defb "HELLO WORLD!"
#line 125
__LABEL__text01end:
	ld hl, 0
	ld b, h
	ld c, l
__END_PROGRAM:
	di
	ld hl, (__CALL_BACK__)
	ld sp, hl
	exx
	pop hl
	pop iy
	pop ix
	exx
	ei
	ret
__CALL_BACK__:
	DEFW 0
_msxvideo9990initsuperimpose:
	push ix
	ld ix, 0
	add ix, sp
	ld a, 0
	ld bc, 111
	out (c), a
_msxvideo9990initsuperimpose__leave:
	ld sp, ix
	pop ix
	ret
_msxvideo9990cleanregisters:
	push ix
	ld ix, 0
	add ix, sp
	ld hl, 0
	ld (_msxvideo9990cleanregisters_tzrg0l), hl
	jp __LABEL69
__LABEL72:
	ld hl, (_msxvideo9990cleanregisters_tzrg0l)
	ld a, l
	ld bc, 100
	out (c), a
	ld a, 0
	ld bc, 99
	out (c), a
	ld hl, (_msxvideo9990cleanregisters_tzrg0l)
	inc hl
	ld (_msxvideo9990cleanregisters_tzrg0l), hl
__LABEL69:
	ld hl, 23
	ld de, (_msxvideo9990cleanregisters_tzrg0l)
	or a
	sbc hl, de
	jp nc, __LABEL72
_msxvideo9990cleanregisters__leave:
	ld sp, ix
	pop ix
	ret
_msxvideo9990vdp:
	push ix
	ld ix, 0
	add ix, sp
	ld a, (ix+5)
	ld bc, 100
	out (c), a
	ld a, (ix+7)
	ld bc, 99
	out (c), a
_msxvideo9990vdp__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	ex (sp), hl
	exx
	ret
_msxvideo9990palette12bit:
	push ix
	ld ix, 0
	add ix, sp
	ld a, 142
	ld bc, 100
	out (c), a
	ld a, (ix+5)
	add a, a
	add a, a
	ld bc, 99
	out (c), a
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 256
	call __DIVU16
	ld de, 0
	push de
	push hl
	ld de, 0
	ld hl, 15
	call __BAND32
	push de
	push hl
	ld de, 0
	ld hl, 2
	call __MUL32
	ld a, l
	ld bc, 97
	out (c), a
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 16
	call __DIVU16
	ld de, 0
	push de
	push hl
	ld de, 0
	ld hl, 15
	call __BAND32
	push de
	push hl
	ld de, 0
	ld hl, 2
	call __MUL32
	ld a, l
	ld bc, 97
	out (c), a
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 15
	call __BAND16
	add hl, hl
	ld a, l
	ld bc, 97
	out (c), a
_msxvideo9990palette12bit__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	ex (sp), hl
	exx
	ret
_msxvideo9990vpokelocp:
	push ix
	ld ix, 0
	add ix, sp
	ld a, 0
	ld bc, 100
	out (c), a
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 0
	push de
	push hl
	ld de, 0
	ld hl, 255
	call __BAND32
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 256
	call __DIVU16
	ld de, 0
	push de
	push hl
	ld de, 0
	ld hl, 255
	call __BAND32
	ld a, l
	ld bc, 99
	out (c), a
	ld a, (ix+5)
	ld bc, 99
	out (c), a
_msxvideo9990vpokelocp__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	ex (sp), hl
	exx
	ret
_msxvideo9990vpokeseq:
	push ix
	ld ix, 0
	add ix, sp
	ld a, (ix+5)
	ld bc, 96
	out (c), a
_msxvideo9990vpokeseq__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	ex (sp), hl
	exx
	ret
_msxrnd:
#line 2
		ld  d, h
		ld  e, l
		ld  a, d
		ld  h, e
		ld  l, 253
		or  a
		sbc  hl, de
		sbc  a, 0
		sbc  hl, de
		ld  d, 0
		sbc  a, d
		ld  e, a
		sbc  hl, de
		jr  nc, smsrndloop
		inc  hl
smsrndloop:
		ret
#line 19
_msxrnd__leave:
	ret
_msxvideo9990command:
	push ix
	ld ix, 0
	add ix, sp
__LABEL74:
	ld bc, 101
	in a, (c)
	ld h, 1
	and h
	or a
	jp nz, __LABEL74
	ld a, 32
	ld bc, 100
	out (c), a
	ld l, (ix+4)
	ld h, (ix+5)
	ld de, 255
	call __BAND16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+4)
	ld h, (ix+5)
	ld de, 256
	call __DIVU16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 255
	call __BAND16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+6)
	ld h, (ix+7)
	ld de, 256
	call __DIVU16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+8)
	ld h, (ix+9)
	ld de, 255
	call __BAND16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+8)
	ld h, (ix+9)
	ld de, 256
	call __DIVU16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+10)
	ld h, (ix+11)
	ld de, 255
	call __BAND16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+10)
	ld h, (ix+11)
	ld de, 256
	call __DIVU16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+12)
	ld h, (ix+13)
	ld de, 255
	call __BAND16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+12)
	ld h, (ix+13)
	ld de, 256
	call __DIVU16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+14)
	ld h, (ix+15)
	ld de, 255
	call __BAND16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+14)
	ld h, (ix+15)
	ld de, 256
	call __DIVU16
	ld a, l
	ld bc, 99
	out (c), a
	ld a, (ix+17)
	ld bc, 99
	out (c), a
	ld a, (ix+19)
	ld bc, 99
	out (c), a
	ld l, (ix+20)
	ld h, (ix+21)
	ld de, 255
	call __BAND16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+20)
	ld h, (ix+21)
	ld de, 256
	call __DIVU16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+22)
	ld h, (ix+23)
	ld de, 255
	call __BAND16
	ld a, l
	ld bc, 99
	out (c), a
	ld l, (ix+22)
	ld h, (ix+23)
	ld de, 256
	call __DIVU16
	ld a, l
	ld bc, 99
	out (c), a
	ld a, 52
	ld bc, 100
	out (c), a
	ld a, (ix+25)
	ld bc, 99
	out (c), a
_msxvideo9990command__leave:
	exx
	ld hl, 22
__EXIT_FUNCTION:
	ld sp, ix
	pop ix
	pop de
	add hl, sp
	ld sp, hl
	push de
	exx
	ret
_ikpp4b:
	push ix
	ld ix, 0
	add ix, sp
	ld a, 128
	ld (_ikpp4b_tmk1), a
	xor a
	ld (_ikpp4b_tlp0), a
	jp __LABEL76
__LABEL79:
	ld hl, 0
	ld (_ikpp4b_tov1), hl
	xor a
	ld (_ikpp4b_tlp1), a
	jp __LABEL81
__LABEL84:
	ld hl, (_ikpp4b_tov1)
	ld de, 16
	call __MUL16_FAST
	ld (_ikpp4b_tov1), hl
	ld a, (ix+5)
	ld h, a
	ld a, (_ikpp4b_tmk1)
	and h
	or a
	jp z, __LABEL86
	ld a, (ix+7)
	ld h, 15
	and h
	ld l, a
	ld h, 0
	ex de, hl
	ld hl, (_ikpp4b_tov1)
	call __BOR16
	ld (_ikpp4b_tov1), hl
	jp __LABEL87
__LABEL86:
	ld a, (ix+9)
	ld h, 15
	and h
	ld l, a
	ld h, 0
	ex de, hl
	ld hl, (_ikpp4b_tov1)
	call __BOR16
	ld (_ikpp4b_tov1), hl
__LABEL87:
	ld a, (_ikpp4b_tmk1)
	srl a
	ld (_ikpp4b_tmk1), a
	ld a, (_ikpp4b_tlp1)
	inc a
	ld (_ikpp4b_tlp1), a
__LABEL81:
	ld a, 1
	ld hl, (_ikpp4b_tlp1 - 1)
	cp h
	jp nc, __LABEL84
	ld hl, (_ikpp4b_tov1)
	ld a, l
	ld bc, 98
	out (c), a
	ld a, (_ikpp4b_tlp0)
	add a, 2
	ld (_ikpp4b_tlp0), a
__LABEL76:
	ld a, 7
	ld hl, (_ikpp4b_tlp0 - 1)
	cp h
	jp nc, __LABEL79
_ikpp4b__leave:
	ld sp, ix
	pop ix
	exx
	pop hl
	pop bc
	pop bc
	ex (sp), hl
	exx
	ret
_putchar:
	push ix
	ld ix, 0
	add ix, sp
	ld a, 16
	push af
	ld hl, 0
	push hl
	ld hl, 65535
	push hl
	ld a, 12
	push af
	xor a
	push af
	ld hl, 8
	push hl
	ld hl, 8
	push hl
	ld l, (ix+6)
	ld h, (ix+7)
	add hl, hl
	add hl, hl
	add hl, hl
	push hl
	ld l, (ix+14)
	ld h, (ix+15)
	ex de, hl
	pop hl
	add hl, de
	push hl
	ld l, (ix+4)
	ld h, (ix+5)
	add hl, hl
	add hl, hl
	add hl, hl
	push hl
	ld hl, 0
	push hl
	ld hl, 0
	push hl
	call _msxvideo9990command
	ld hl, 0
	ld (_putchar_tln0), hl
	jp __LABEL88
__LABEL91:
	ld a, (ix+13)
	push af
	ld a, (ix+11)
	push af
	ld l, (ix+18)
	ld h, (ix+19)
	ex de, hl
	ld hl, (_putchar_tln0)
	add hl, de
	push hl
	ld l, (ix+8)
	ld h, (ix+9)
	push hl
	ld l, (ix+16)
	ld h, (ix+17)
	ex de, hl
	pop hl
	add hl, de
	add hl, hl
	add hl, hl
	add hl, hl
	ex de, hl
	pop hl
	add hl, de
	ld a, (hl)
	push af
	call _ikpp4b
	ld hl, (_putchar_tln0)
	inc hl
	ld (_putchar_tln0), hl
__LABEL88:
	ld hl, 7
	ld de, (_putchar_tln0)
	or a
	sbc hl, de
	jp nc, __LABEL91
_putchar__leave:
	exx
	ld hl, 16
	jp __EXIT_FUNCTION
_writetext:
	push ix
	ld ix, 0
	add ix, sp
	ld hl, 0
	ld (_writetext_ttlp0), hl
	jp __LABEL93
__LABEL96:
	ld l, (ix+18)
	ld h, (ix+19)
	push hl
	ld hl, 0
	push hl
	ld l, (ix+16)
	ld h, (ix+17)
	push hl
	ld a, (ix+15)
	push af
	ld a, (ix+13)
	push af
	ld l, (ix+8)
	ld h, (ix+9)
	ex de, hl
	ld hl, (_writetext_ttlp0)
	add hl, de
	ld a, (hl)
	ld l, a
	ld h, 0
	push hl
	ld l, (ix+6)
	ld h, (ix+7)
	push hl
	ld l, (ix+4)
	ld h, (ix+5)
	ex de, hl
	ld hl, (_writetext_ttlp0)
	add hl, de
	push hl
	call _putchar
	ld hl, (_writetext_ttlp0)
	inc hl
	ld (_writetext_ttlp0), hl
__LABEL93:
	ld l, (ix+10)
	ld h, (ix+11)
	dec hl
	ld de, (_writetext_ttlp0)
	or a
	sbc hl, de
	jp nc, __LABEL96
_writetext__leave:
	exx
	ld hl, 16
	jp __EXIT_FUNCTION
#line 1 "and8.asm"
	
	; FASTCALL boolean and 8 version.
	; result in Accumulator (0 False, not 0 True)
; __FASTCALL__ version (operands: A, H)
	; Performs 8bit and 8bit and returns the boolean
	
__AND8:
		or a
		ret z
		ld a, h
		ret 
	
#line 1900 "example08.bas"
#line 1 "band16.asm"
	
; vim:ts=4:et:
	; FASTCALL bitwise and16 version.
	; result in hl 
; __FASTCALL__ version (operands: A, H)
	; Performs 16bit or 16bit and returns the boolean
; Input: HL, DE
; Output: HL <- HL AND DE
	
__BAND16:
		ld a, h
		and d
	    ld h, a
	
	    ld a, l
	    and e
	    ld l, a
	
	    ret 
	
#line 1901 "example08.bas"
#line 1 "band32.asm"
	
	; FASTCALL bitwise and 32 version.
	; Performs 32bit and 32bit and returns the bitwise
	; result in DE,HL
	; First operand in DE,HL 2nd operand into the stack
	
__BAND32:
	    ld b, h
	    ld c, l ; BC <- HL
	
	    pop hl  ; Return address
	    ex (sp), hl ; HL <- Lower part of 2nd Operand
	
		ld a, b
	    and h
	    ld b, a
	
	    ld a, c
	    and l
	    ld c, a ; BC <- BC & HL
	
		pop hl  ; Return dddress
	    ex (sp), hl ; HL <- High part of 2nd Operand
	
	    ld a, d
	    and h
	    ld d, a
	
	    ld a, e
	    and l
	    ld e, a ; DE <- DE & HL
	
	    ld h, b
	    ld l, c ; HL <- BC  ; Always return DE,HL pair regs
	
	    ret
	
#line 1902 "example08.bas"
#line 1 "bor16.asm"
	
; vim:ts=4:et:
	; FASTCALL bitwise or 16 version.
	; result in HL
; __FASTCALL__ version (operands: A, H)
	; Performs 16bit or 16bit and returns the boolean
; Input: HL, DE
; Output: HL <- HL OR DE
	
__BOR16:
		ld a, h
		or d
	    ld h, a
	
	    ld a, l
	    or e
	    ld l, a
	
	    ret 
	
#line 1903 "example08.bas"
#line 1 "div16.asm"
	
	; 16 bit division and modulo functions 
	; for both signed and unsigned values
	
#line 1 "neg16.asm"
	
	; Negates HL value (16 bit)
__ABS16:
		bit 7, h
		ret z
	
__NEGHL:
		ld a, l			; HL = -HL
		cpl
		ld l, a
		ld a, h
		cpl
		ld h, a
		inc hl
		ret
	
#line 5 "div16.asm"
	
__DIVU16:    ; 16 bit unsigned division
	             ; HL = Dividend, Stack Top = Divisor
	
		;   -- OBSOLETE ; Now uses FASTCALL convention
		;   ex de, hl
	    ;	pop hl      ; Return address
	    ;	ex (sp), hl ; CALLEE Convention
	
__DIVU16_FAST:
	    ld a, h
	    ld c, l
	    ld hl, 0
	    ld b, 16
	
__DIV16LOOP:
	    sll c
	    rla
	    adc hl,hl
	    sbc hl,de
	    jr  nc, __DIV16NOADD
	    add hl,de
	    dec c
	
__DIV16NOADD:
	    djnz __DIV16LOOP
	
	    ex de, hl
	    ld h, a
	    ld l, c
	
	    ret     ; HL = quotient, DE = Mudulus
	
	
	
__MODU16:    ; 16 bit modulus
	             ; HL = Dividend, Stack Top = Divisor
	
	    ;ex de, hl
	    ;pop hl
	    ;ex (sp), hl ; CALLEE Convention
	
	    call __DIVU16_FAST
	    ex de, hl	; hl = reminder (modulus)
					; de = quotient
	
	    ret
	
	
__DIVI16:	; 16 bit signed division
		;	--- The following is OBSOLETE ---
		;	ex de, hl
		;	pop hl
		;	ex (sp), hl 	; CALLEE Convention
	
__DIVI16_FAST:
		ld a, d
		xor h
		ex af, af'		; BIT 7 of a contains result
	
		bit 7, d		; DE is negative?
		jr z, __DIVI16A	
	
		ld a, e			; DE = -DE
		cpl
		ld e, a
		ld a, d
		cpl
		ld d, a
		inc de
	
__DIVI16A:
		bit 7, h		; HL is negative?
		call nz, __NEGHL
	
__DIVI16B:
		call __DIVU16_FAST
		ex af, af'
	
		or a	
		ret p	; return if positive
	    jp __NEGHL
	
		
__MODI16:    ; 16 bit modulus
	             ; HL = Dividend, Stack Top = Divisor
	
	    ;ex de, hl
	    ;pop hl
	    ;ex (sp), hl ; CALLEE Convention
	
	    call __DIVI16_FAST
	    ex de, hl	; hl = reminder (modulus)
					; de = quotient
	
	    ret
	
#line 1904 "example08.bas"
#line 1 "div32.asm"
	
#line 1 "neg32.asm"
	
__ABS32:
		bit 7, d
		ret z
	
__NEG32: ; Negates DEHL (Two's complement)
		ld a, l
		cpl
		ld l, a
	
		ld a, h
		cpl
		ld h, a
	
		ld a, e
		cpl
		ld e, a
		
		ld a, d
		cpl
		ld d, a
	
		inc l
		ret nz
	
		inc h
		ret nz
	
		inc de
		ret
	
#line 2 "div32.asm"
	
				 ; ---------------------------------------------------------
__DIVU32:    ; 32 bit unsigned division
	             ; DEHL = Dividend, Stack Top = Divisor
	             ; OPERANDS P = Dividend, Q = Divisor => OPERATION => P / Q
				 ;
				 ; Changes A, BC DE HL B'C' D'E' H'L'
				 ; ---------------------------------------------------------
	        exx
	        pop hl   ; return address
	        pop de   ; low part
	        ex (sp), hl ; CALLEE Convention ; H'L'D'E' => Dividend
	
__DIVU32START: ; Performs D'E'H'L' / HLDE
	        ; Now switch to DIVIDEND = B'C'BC / DIVISOR = D'E'DE (A / B)
	        push de ; push Lowpart(Q)
			ex de, hl	; DE = HL
	        ld hl, 0
	        exx
	        ld b, h
	        ld c, l
	        pop hl
	        push de
	        ex de, hl
	        ld hl, 0        ; H'L'HL = 0
	        exx
	        pop bc          ; Pop HightPart(B) => B = B'C'BC
	        exx
	
	        ld a, 32 ; Loop count
	
__DIV32LOOP:
	        sll c  ; B'C'BC << 1 ; Output most left bit to carry
	        rl  b
	        exx
	        rl c
	        rl b
	        exx
	
	        adc hl, hl
	        exx
	        adc hl, hl
	        exx
	
	        sbc hl,de
	        exx
	        sbc hl,de
	        exx
	        jp nc, __DIV32NOADD	; use JP inside a loop for being faster
	
	        add hl, de
	        exx
	        adc hl, de
	        exx
	        dec bc
	
__DIV32NOADD:
	        dec a
	        jp nz, __DIV32LOOP	; use JP inside a loop for being faster
	        ; At this point, quotient is stored in B'C'BC and the reminder in H'L'HL
	
	        push hl
	        exx
	        pop de
	        ex de, hl ; D'E'H'L' = 32 bits modulus
	        push bc
	        exx
	        pop de    ; DE = B'C'
	        ld h, b
	        ld l, c   ; DEHL = quotient D'E'H'L' = Modulus
	
	        ret     ; DEHL = quotient, D'E'H'L' = Modulus
	
	
	
__MODU32:    ; 32 bit modulus for 32bit unsigned division
	             ; DEHL = Dividend, Stack Top = Divisor (DE, HL)
	
	        exx
	        pop hl   ; return address
	        pop de   ; low part
	        ex (sp), hl ; CALLEE Convention ; H'L'D'E' => Dividend
	
	        call __DIVU32START	; At return, modulus is at D'E'H'L'
	
__MODU32START:
	
			exx
			push de
			push hl
	
			exx 
			pop hl
			pop de
	
			ret
	
	
__DIVI32:    ; 32 bit signed division
	             ; DEHL = Dividend, Stack Top = Divisor
	             ; A = Dividend, B = Divisor => A / B
	        exx
	        pop hl   ; return address
	        pop de   ; low part
	        ex (sp), hl ; CALLEE Convention ; H'L'D'E' => Dividend
	
__DIVI32START:
			exx
			ld a, d	 ; Save sign
			ex af, af'
			bit 7, d ; Negative?
			call nz, __NEG32 ; Negates DEHL
	
			exx		; Now works with H'L'D'E'
			ex af, af'
			xor h
			ex af, af'  ; Stores sign of the result for later
	
			bit 7, h ; Negative?
			ex de, hl ; HLDE = DEHL
			call nz, __NEG32
			ex de, hl 
	
			call __DIVU32START
			ex af, af' ; Recovers sign
			and 128	   ; positive?
			ret z
	
			jp __NEG32 ; Negates DEHL and returns from there
			
			
__MODI32:	; 32bits signed division modulus
			exx
	        pop hl   ; return address
	        pop de   ; low part
	        ex (sp), hl ; CALLEE Convention ; H'L'D'E' => Dividend
	
			call __DIVI32START
			jp __MODU32START		
	
#line 1905 "example08.bas"
#line 1 "mul16.asm"
	
__MUL16:	; Mutiplies HL with the last value stored into de stack
				; Works for both signed and unsigned
	
			PROC
	
			LOCAL __MUL16LOOP
	        LOCAL __MUL16NOADD
			
			ex de, hl
			pop hl		; Return address
			ex (sp), hl ; CALLEE caller convention
	
;;__MUL16_FAST:	; __FASTCALL ENTRY: HL = 1st operand, DE = 2nd Operand
	;;		ld c, h
	;;		ld a, l	 ; C,A => 1st Operand
	;;
	;;		ld hl, 0 ; Accumulator
	;;		ld b, 16
	;;
;;__MUL16LOOP:
	;;		sra c	; C,A >> 1  (Arithmetic)
	;;		rra
	;;
	;;		jr nc, __MUL16NOADD
	;;		add hl, de
	;;
;;__MUL16NOADD:
	;;		sla e
	;;		rl d
	;;			
	;;		djnz __MUL16LOOP
	
__MUL16_FAST:
	        ld b, 16
	        ld a, d
	        ld c, e
	        ex de, hl
	        ld hl, 0
	
__MUL16LOOP:
	        add hl, hl  ; hl << 1
	        sla c
	        rla         ; a,c << 1
	        jp nc, __MUL16NOADD
	        add hl, de
	
__MUL16NOADD:
	        djnz __MUL16LOOP
	
			ret	; Result in hl (16 lower bits)
	
			ENDP
	
#line 1906 "example08.bas"
#line 1 "mul32.asm"
	
#line 1 "_mul32.asm"
	
	
; Ripped from: http://www.andreadrian.de/oldcpu/z80_number_cruncher.html#moztocid784223
	; Used with permission.
	; Multiplies 32x32 bit integer (DEHL x D'E'H'L')
	; 64bit result is returned in H'L'H L B'C'A C
	
	
__MUL32_64START:
			push hl
			exx
			ld b, h
			ld c, l		; BC = Low Part (A)
			pop hl		; HL = Load Part (B)
			ex de, hl	; DE = Low Part (B), HL = HightPart(A) (must be in B'C')
			push hl
	
			exx
			pop bc		; B'C' = HightPart(A)
			exx			; A = B'C'BC , B = D'E'DE
	
				; multiply routine 32 * 32bit = 64bit
				; h'l'hlb'c'ac = b'c'bc * d'e'de
				; needs register a, changes flags
				;
				; this routine was with tiny differences in the
				; sinclair zx81 rom for the mantissa multiply
	
__LMUL:
	        and     a               ; reset carry flag
	        sbc     hl,hl           ; result bits 32..47 = 0
	        exx
	        sbc     hl,hl           ; result bits 48..63 = 0
	        exx
	        ld      a,b             ; mpr is b'c'ac
	        ld      b,33            ; initialize loop counter
	        jp      __LMULSTART  
	
__LMULLOOP:
	        jr      nc,__LMULNOADD  ; JP is 2 cycles faster than JR. Since it's inside a LOOP
	                                ; it can save up to 33 * 2 = 66 cycles
	                                ; But JR if 3 cycles faster if JUMP not taken!
	        add     hl,de           ; result += mpd
	        exx
	        adc     hl,de
	        exx
	
__LMULNOADD:
	        exx
	        rr      h               ; right shift upper
	        rr      l               ; 32bit of result
	        exx
	        rr      h
	        rr      l
	
__LMULSTART:
	        exx
	        rr      b               ; right shift mpr/
	        rr      c               ; lower 32bit of result
	        exx
	        rra                     ; equivalent to rr a
	        rr      c
	        djnz    __LMULLOOP
	
			ret						; result in h'l'hlb'c'ac
	       
#line 2 "mul32.asm"
	
__MUL32:	; multiplies 32 bit un/signed integer.
				; First operand stored in DEHL, and 2nd onto stack
				; Lowest part of 2nd operand on top of the stack
				; returns the result in DE.HL
			exx
			pop hl	; Return ADDRESS
			pop de	; Low part
			ex (sp), hl ; CALLEE -> HL = High part
			ex de, hl
			call __MUL32_64START
	
__TO32BIT:  ; Converts H'L'HLB'C'AC to DEHL (Discards H'L'HL)
			exx
			push bc
			exx
			pop de
			ld h, a
			ld l, c
			ret
	
	
#line 1907 "example08.bas"
#line 1 "swap32.asm"
	
	; Exchanges current DE HL with the
	; ones in the stack
	
__SWAP32:
		pop bc ; Return address
	    ex (sp), hl
	    dec sp
	    dec sp
	    ex de, hl
	    ex (sp), hl
	    ex de, hl
	    inc sp
	    inc sp
	    push bc
		ret
	
#line 1908 "example08.bas"
	
ZXBASIC_USER_DATA:
	_msxvideo9990cleanregisters_tzrg0l EQU 49152
	_i EQU 49168
	_x EQU 49180
	_dx EQU 49190
	_dy EQU 49192
	_fc EQU 49204
	_seed EQU 49206
	_ik EQU 49208
	_pp EQU 49210
	_e0 EQU 49216
	_e1 EQU 49218
	_ikpp4b_tlp0 EQU 49152
	_ikpp4b_tlp1 EQU 49153
	_ikpp4b_tmk1 EQU 49154
	_ikpp4b_tov1 EQU 49156
	_putchar_tln0 EQU 49158
	_writetext_ttlp0 EQU 49160
	; Defines DATA END --> HEAP size is 0
ZXBASIC_USER_DATA_END EQU ZXBASIC_MEM_HEAP
	; Defines USER DATA Length in bytes
ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA
	END
